package Test.ThirdOne;

public class Teacher extends Person {
    private int tID;
    private String department;

    /**
     * 带参数构造器
     */
    public Teacher(String name,char sex,int age,int tID,String department){
        super(name, sex, age);
        this.tID=tID;
        this.department=department;
    }

    /**
     * 设置
     * @param name       姓名
     * @param sex        性别
     * @param age        年龄
     * @param tID        工号
     * @param department 部门
     */
    public void setData(String name,char sex,int age,int tID,String department){
        super.setData(name,sex,age);
        this.tID=tID;
        this.department=department;
    }

    /**
     * 获取Teacher详细信息
     * @return String
     */
    @Override
    public String getData(){
        String s=super.getData();
        return s+" 工号："+tID+" 部门："+department;
    }

    public static void main(String[] args) {
        Teacher teacher=new Teacher("张三",'男',45,78,"信软学院");
        System.out.println(teacher.getData());
    }

}
